package com.zuipin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zuipin.entity.InvoiceInfo;
import com.zuipin.mapper.InvoiceInfoMapper;
import com.zuipin.service.IInvoiceInfoService;
import com.zuipin.util.ConstantsUtil;
import com.zuipin.util.DateUtils;

/**
 * @ClassName: InvoiceInfoServiceImpl
 * @author wuyicheng
 * @time 2017年3月27日下午4:03:39
 */
@Service
public class InvoiceInfoServiceImpl implements IInvoiceInfoService {
	@Resource
	private InvoiceInfoMapper	invoiceInfoMapper;
	
	/**
	 * @Title: findById
	 * @author: wuyicheng
	 * @date: 2017年3月27日下午5:34:39
	 * @param id
	 * @return
	 * @throws
	 */
	@Override
	public InvoiceInfo findById(Long id) {
		return invoiceInfoMapper.findById(id);
	}
	
	/**
	 * @Title: findList
	 * @author: wuyicheng
	 * @date: 2017年3月27日下午5:34:39
	 * @param invoiceInfo
	 * @return
	 * @throws
	 */
	@Override
	public List<InvoiceInfo> findList(InvoiceInfo invoiceInfo) {
		return null;
	}
	
	/**
	 * @Title: insert
	 * @author: wuyicheng
	 * @date: 2017年3月27日下午5:34:39
	 * @param invoiceInfo
	 * @throws
	 */
	@Override
	public void insert(InvoiceInfo invoiceInfo) {
		invoiceInfo.setCreateTime(DateUtils.getCurrentDateTime());
		invoiceInfo.setUpdateTime(DateUtils.getCurrentDateTime());
		invoiceInfo.setDelFlag(ConstantsUtil.DEL_FLAG_NO_0);
		invoiceInfoMapper.insert(invoiceInfo);
	}
	
	/**
	 * @Title: update
	 * @author: wuyicheng
	 * @date: 2017年3月27日下午5:34:39
	 * @param invoiceInfo
	 * @throws
	 */
	@Override
	public void update(InvoiceInfo invoiceInfo) {
		invoiceInfo.setUpdateTime(DateUtils.getCurrentDateTime());
		invoiceInfoMapper.update(invoiceInfo);
		
	}
	
	/**
	 * @Title: deleteById
	 * @author: wuyicheng
	 * @date: 2017年3月27日下午5:34:39
	 * @param id
	 * @throws
	 */
	@Override
	public void deleteById(Long id) {
		InvoiceInfo invoiceInfo = new InvoiceInfo();
		invoiceInfo.setDelFlag(ConstantsUtil.DEL_FLAG_YES_1);
		update(invoiceInfo);
		
	}
	
}
